<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" lang="en">
<head>
    <meta charset="utf-8">
    <title>主页一</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="../../static/lib/layui-v2.5.5/css/layui.css" media="all">
    <link rel="stylesheet" href="../../static/lib/font-awesome-4.7.0/css/font-awesome.min.css" media="all">
    <link rel="stylesheet" href="../../static/css/public.css" media="all">
</head>
<style>
    .layui-top-box {
        padding: 40px 20px 20px 20px;
        color: #fff
    }

    .panel {
        /*float: left;*/
        margin-bottom: 17px;
        background-color: #fff;
        border: 1px solid transparent;
        border-radius: 3px;
        -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, .05);
        box-shadow: 0 1px 1px rgba(0, 0, 0, .05)
    }

    .panel-body {
        padding: 15px
    }

    .panel-title {
        margin-top: 0;
        margin-bottom: 0;
        font-size: 14px;
        color: inherit
    }

    .label {
        display: inline;
        padding: .2em .6em .3em;
        font-size: 75%;
        font-weight: 700;
        line-height: 1;
        color: #fff;
        text-align: center;
        white-space: nowrap;
        vertical-align: baseline;
        border-radius: .25em;
        margin-top: .3em;
    }

    .layui-red {
        color: red
    }

    .main_btn > p {
        height: 40px;
    }
</style>
<body>
<div class="layuimini-container">
    <div class="layuimini-main layui-top-box">
        <div class="layui-row layui-col-space10">
            <div class="layui-col-md3" th:each="app, sta:${apps}">
                <div class="col-xs-6 col-md-3" th:switch="${sta.index % 4}">
                    <div th:case=0 class="panel layui-bg-cyan" th:id="${app}" onclick="detailByApp(id)">
                        <div class="panel-body">
                            <div class="panel-title">
                                <span class="label pull-right layui-bg-blue">正常</span>
                                <h5>应用状态</h5>
                            </div>
                            <div class="panel-content">
                                <h1 class="no-margins" th:text="${app}"></h1>
                            </div>
                        </div>
                    </div>
                    <div th:case=1 class="panel layui-bg-blue" th:id="${app}" onclick="detailByApp(id)">
                        <div class="panel-body">
                            <div class="panel-title">
                                <span class="label pull-right layui-bg-blue">正常</span>
                                <h5>应用状态</h5>
                            </div>
                            <div class="panel-content">
                                <h1 class="no-margins" th:text="${app}"></h1>
                            </div>
                        </div>
                    </div>
                    <div th:case=2 class="panel layui-bg-green" th:id="${app}" onclick="detailByApp(id)">
                        <div class="panel-body">
                            <div class="panel-title">
                                <span class="label pull-right layui-bg-blue">正常</span>
                                <h5>应用状态</h5>
                            </div>
                            <div class="panel-content">
                                <h1 class="no-margins" th:text="${app}"></h1>
                            </div>
                        </div>
                    </div>
                    <div th:case=3 class="panel layui-bg-orange" th:id="${app}" onclick="detailByApp(id)">
                        <div class="panel-body">
                            <div class="panel-title">
                                <span class="label pull-right layui-bg-blue">正常</span>
                                <h5>应用状态</h5>
                            </div>
                            <div class="panel-content">
                                <h1 class="no-margins" th:text="${app}"></h1>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script src="../../static/lib/layui-v2.5.5/layui.js" charset="utf-8"></script>
<script th:inline="javascript">
    layui.use(['jquery', 'layer', 'miniAdmin', 'miniTongji'], function () {
        let $ = layui.jquery;
        $(function () {
            $.ajax({
                url: "/v1/audit/app", success: function (result) {
                }
            });
        });
    });

    function detailByApp(app) {
        window.location.href = "/templates/page/table.html?appId=" + app
        /*let $ = layui.jquery;
        $.ajax({
            type: "POST",
            contentType: "application/json",
            data:JSON.stringify({
                appId:app
            }),
            url: "/v1/audit/query", success: function (result) {

            }
        });*/
    }
</script>
</body>
</html>